#include "stdafx.h"
#include "Game.h"
#include "DataBase.h"

int main(int argc, char* argv[])
{
	Game _g;
	std::string temp;

	try 
	{
		std::cout << "Please enter ip : ";
		std::cin >> temp;
		std::cout << std::endl;
		DataBase::getInstance()->setIp(temp);
		temp = "";

		std::cout << "Please enter port : ";
		std::cin >> temp;
		std::cout << std::endl;
		DataBase::getInstance()->setPort(atoi(temp.c_str()));
		temp = "";

		std::cout << "Please enter number : ";
		std::cin >> temp;
		std::cout << std::endl;
		DataBase::getInstance()->setNumberPlayer(atoi(temp.c_str()));
		temp = "";

		_g.Start();
	}
	catch( Ogre::Exception& e )
	{
		#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
		MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
		#else
		std::cerr << "An exception has occured: " << e.getFullDescription().c_str() << std::endl;
		#endif
	}
	return 0;
}